<script>
	import config from './config'
	import store from '@/store'
	import {
		getToken
	} from '@/utils/auth'
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			this.initApp()
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			// 初始化应用
			initApp() {
				// 初始化应用配置
				this.initConfig()

				// 检查登录状态
				this.checkLogin()

			},
			initConfig() {
				this.globalData.config = config
			},
			checkLogin() {
				console.log(getToken(), 'getToken()');
				if (!getToken()) {
					uni.setStorageSync('isLogin', false)
				} else {
					uni.setStorageSync('isLogin', true)
				}
			}
		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	@import './components/common/aliIcon.css';
	/* 自定义公共样式 */
	@import './components/common/main.css';

	/*每个页面公共css */
	page {
		background-color: #F6F8F9;
	}
</style>